<?php

declare(strict_types=1);

namespace App\Http\Common;

use Hyperf\Constants\Annotation\Constants;
use Hyperf\Constants\Annotation\Message;
use Hyperf\Constants\ConstantsTrait;

#[Constants]
enum ResultCode: int
{
    use ConstantsTrait;

    #[Message("执行成功")]
    case SUCCESS = 200;

    #[Message("程序错误")]
    case FAIL = 500;

    #[Message("请先授权")]
    case UNAUTHORIZED = 401;

    #[Message("请求被拒绝")]
    case FORBIDDEN = 403;

    #[Message("请求的资源不存在")]
    case NOT_FOUND = 404;

    #[Message("请求方法不允许")]
    case METHOD_NOT_ALLOWED = 405;

    #[Message("请求的资源不可接受")]
    case NOT_ACCEPTABLE = 406;

    #[Message("请求的资源不可用")]
    case UNPROCESSABLE_ENTITY = 422;

    #[Message("请求的资源被禁用")]
    case DISABLED = 423;
}
